<template>
    {{ count }}
    <button @click="handlClick">click</button>
</template>

<script>
import { reactive, toRefs, watchEffect } from 'vue';

export default {
    setup () {
        const state = reactive({
            count: 1,
        });
        watchEffect(
            () => {
                console.log(state.count);
            },
        );
        const handlClick = () => {
            state.count += 1;
        };
        return {
            ...toRefs(state), handlClick,
        };
    },
};
</script>

<style>

</style>
